/**
 * 
 */
package kernel_gui.interfaces.kernel_gui;

import common.entities.persistent.User;

/**
 * @author Yoyo
 *
 */
public interface IKernelGeneral {
	
	/* Login */
	
	/**
	 * Logins a registered user into the system
	 * Optional: the user can log as administrator
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param userName
	 * @param password
	 * @param loggedAsAdmin - indicates whether the user has logged
	 */
	void authenticateUser(String userName, String password, boolean loggedAsAdmin, int requestId);
	
	/**
	 * Checks if the current user is logged in as administrator
	 * @return true if the user is logged as administrator, otherwise, false
	 */
	boolean isAdministrator();
	
	/* Hall of fame */
	
	/**
	 * Calculates current top users (users with most points)
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with List<Users> containing top users
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 * @param numberOfUsers - determines the maximal number of top users to return (the function can return less than max)
	 */
	void hallOfFame(int numberOfUsers, int requestId);
	
	
	/* My profile */
	
	/**
	 *  Get current logged-in user
	 *  
	 * @return current logged in user 
	 */
	User getCurrentUser();
	
	/* Exit && Logout*/
	
	/**
	 * Frees user-allocated resources and logs-out current user
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br> 
	 */
	void logOut(int requestId);
	
	/**
	 * Frees all allocated resources and closes game
	 * <br><br>
	 * <b>On Success</b> - will call gui's returnAnswer with Boolean value 'true'
	 * <br>
	 * <b>On fail</b> - will call gui's returnError with the right error message
	 * <br>
	 */
	void exitMillioner(int requestId);
	
	
}
	
